package org.PropertyManageMentSystem.Client;

import org.PropertyManageMentSystem.Data.Director;
import org.PropertyManageMentSystem.Data.MysqlConfig;
import org.PropertyManageMentSystem.Servive.DirectorService;
import org.PropertyManageMentSystem.Servive.SchedulerService;
import org.PropertyManageMentSystem.Servive.WorkerService;

import java.sql.SQLException;

public class Client {
    private MysqlConfig mysqlConfig;
    Client(){
        mysqlConfig = new MysqlConfig("jdbc:mysql://10.176.40.198:32000/lab","root","123456");
    }
    public DirectorService getDirectorService(Long id) throws SQLException, ClassNotFoundException {
        return new DirectorService(id,mysqlConfig);
    }

    public WorkerService getWorkerService(Long id) throws Exception {
        return new WorkerService(id,mysqlConfig);
    }

    public SchedulerService getSchedulerService(Long id) throws SQLException, ClassNotFoundException {
        return new SchedulerService(id,mysqlConfig);
    }
}
